<?php
use Fuel\Core\DB;

use Fuel\Core\Model;

class Helper extends Model
{
	public static function Query($sql)
	{
		$query=DB::query($sql);
		$result=$query->execute();
		return $result->as_array();
	}
	public static function Insert($table)
	{
		
	} 
	public static function Update($table,$arrayWhere)
	{
	
	}
	public static function createToken($email){
		//$user = self::check(compact('user_id'),array('email'));
		
			$expire         = strtotime(_EXPIRE_TIME_TOKEN_);
			$token          = $user[0]['email']."@$expire";
			$token          =  encrypt($token);
			return $token;
	}
	/*
	 * $query = DB::query('SELECT * from posts');
		$result = $query->execute();
		$data['posts']= $result->as_array();
		//	$data['username'] = 'Joe14';
		//  $data['title'] = 'Home';
		$this->template->title = 'Example Page';
		//$this->template->content="Tran Thanh An";
		$this->template->content = View::forge('test', $data);
	 */
}